package com.lzx.payment.service;

import com.lzx.payment.entity.OrderInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lzx.payment.enums.OrderStatus;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author lzx
 * @since 2022-12-14
 */
public interface OrderInfoService extends IService<OrderInfo> {

    //生成订单
    OrderInfo createOrderByProductId(Long productId, Long userId, String paymentType);

    //根据订单号查询订单
    OrderInfo getOrderByOrderNo(String outTradeNo);

    //根据订单号更新订单状态
    void updateStatusByOrderNo(String orderNo, OrderStatus orderStatus);

    //根据订单号获取订单状态
    String getOrderStatus(String orderNo);

    //查询创建超过minutes分钟并且未支付的订单
    List<OrderInfo> getNoPayOrderByDuration(int minutes, String paymentType);
}
